#! /bin/sh
# Test arbitrary --greeting.
#
# Copyright (C) 2001-2019 Free Software Foundation, Inc.
#
# Copying and distribution of this file, with or without modification,
# are permitted in any medium without royalty provided the copyright
# notice and this notice are preserved.

trap 'rm -fr $tmpfiles' 1 2 3 15

# No locale settings in this test, since we are using a fixed string;
# nothing in the output should be locale-dependent.

tmpfiles="greeting-test1.ok"
cat <<EOF >greeting-test1.ok
Nothing happens here.
EOF

tmpfiles="$tmpfiles greeting-test1.out"
: ${HELLO=hello}
${HELLO} -g 'Nothing happens here.' | tr -d '\r' >greeting-test1.out

# remove \r (CR) characters from the output, so that the tests work on
# platforms with CRLF line endings.  There is apparently no reliable
# method (across Cygwin, MingW, etc.) to force an eol style.

: ${DIFF=diff}
${DIFF} greeting-test1.ok greeting-test1.out
result=$?

rm -fr $tmpfiles

exit $result
